/*
 * Event Handler
 * @author Gerald <gera2ld@163.com>
 */
function EventHandler(options){
	var self=this,container=options.container;
	self.options=options;
	click=self.click.bind(self);
	container.addEventListener('click',click,false);
	container.addEventListener('contextmenu',click,false);
}
EventHandler.prototype={
	click:function(e){
		e.preventDefault();
		this.call('click',e);
	},
	call:function(type,e){
		var self=this,f=self.options['on'+type],obj={type:type},i;
		for(i in e) obj[i]=e[i];
		if(f) f(obj);
	},
};
